<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="edge"/>
    <meta content="elkan1788#gmail.com" name="author"/>
    <link rel="shortcut icon" href="${base}/static/img/favicon.ico"/>
    <title>东吴对接数据查看</title>

    <link href="${base}/static/vendor/easyui/themes/insdep/easyui.css" rel="stylesheet" type="text/css">
    <link href="${base}/static/vendor/easyui/themes/insdep/default_theme.css" rel="stylesheet" type="text/css">
    <link href="${base}/static/vendor/easyui/themes/insdep/easyui_plus.css" rel="stylesheet" type="text/css">
    <link href="${base}/static/vendor/easyui/themes/insdep/iconfont/iconfont.css" rel="stylesheet" type="text/css">
    <link href="${base}/static/vendor/easyui/themes/insdep/icon.css" rel="stylesheet" type="text/css">

    <style>
        .loadMask {
            width: 100%;
            height: 100%;
            background-color: #fff;
            filter: alpha(opacity=98);
            -moz-opacity: 0.98;
            opacity: 0.98;
            position: absolute;
            left: 0px;
            top: 0px;
            z-index: 998;
            text-align: center;
        }

        .loadMask img {
            position: absolute;
            z-index: 999;
            top: 50%;
            left: 45%;
            width: 18px;
            height: 18px;
        }

    </style>

</head>
<body>

<div id="mainContent" class="easyui-layout" data-options="fit:true">
    <div data-options="region:'north'" style="overflow: hidden;height: 135px;">
        <div class="easyui-panel" data-options="border:0">
            <fieldset style="padding: 10px;margin: 4px; border:1px solid #f0ad4e">
                <legend>查询</legend>
                <input type="hidden" id="dictId" name="dictId"/>
                <div style="margin-bottom:20px;text-align: right">
                    <select id="tableName" name="tableName" class="easyui-combobox theme-textbox-radius" label="表名:"
                            style="width:25%;" data-options="editable:false,
                            onChange: function(newVal,oldVal) {
                                switch(newVal) {
                                    case 'DWCustomer':
                                        $('#centerPanel').children()[0].style.display='block';
                                        $('#centerPanel').children()[1].style.display='none';
                                        $('#centerPanel').children()[2].style.display='none';
                                        $('#centerPanel').children()[3].style.display='none';
                                        break;
                                    case 'DWCustomerSerItem':
                                        $('#centerPanel').children()[0].style.display='none';
                                        $('#centerPanel').children()[1].style.display='block';
                                        $('#centerPanel').children()[2].style.display='none';
                                        $('#centerPanel').children()[3].style.display='none';
                                        break;
                                    case 'DWServicePlan':
                                        $('#centerPanel').children()[0].style.display='none';
                                        $('#centerPanel').children()[1].style.display='none';
                                        $('#centerPanel').children()[2].style.display='block';
                                        $('#centerPanel').children()[3].style.display='none';
                                        break;
                                    case 'DWSerPlanItem':
                                        $('#centerPanel').children()[0].style.display='none';
                                        $('#centerPanel').children()[1].style.display='none';
                                        $('#centerPanel').children()[2].style.display='none';
                                        $('#centerPanel').children()[3].style.display='block';
                                        break;
                                }
                            }">
                        <option value="DWCustomer">客户基础信息</option>
                        <option value="DWCustomerSerItem">客户服务项目</option>
                        <option value="DWServicePlan">服务计划</option>
                        <option value="DWSerPlanItem">服务项目信息</option>
                    </select>
                    <input id="no" name="no" class="easyui-textbox theme-textbox-radius" label="内容:"
                           data-options="prompt:'客户编码、服务计划编号、服务项目编码(可选)'" style="width:48%;"/>
                </div>

                <div style="text-align: right">
                    <!--
                    <input id="startDate" name="startDate" class="easyui-datebox theme-textbox-radius" label="开始日期:"
                           style="width:26%;"
                           data-options="prompt:'请选择开始日期',editable:false,required:false,formatter:dateFormatter,onSelect:onSelected"/>
                    <input id="endDate" name="endDate" class="easyui-datebox theme-textbox-radius" label="结束日期:"
                           style="width:26%;"
                           data-options="prompt:'请选择结束日期',editable:false,required:false,formatter:dateFormatter,validType:'equalStartDate[\'#startDate\']'"/>
                    -->
                    <a id="queryBtn" href="#" class="easyui-linkbutton button-orange button-xs l-btn l-btn-small">
                        <span class="l-btn-left">
                            <span class="l-btn-text">
                                <i class="iconfont">&#xe6ac;</i> 查询
                            </span>
                        </span>
                    </a>
                </div>

            </fieldset>
        </div>
    </div>
    <div id="centerPanel" data-options="region:'center'">
        <table id="customerInfo" title="" class="easyui-datagrid"
               data-options="
                url: '${base}/dw_inter/query/customerList.do',
                title: '客户基础信息',
                iconCls: 'icon-log-viewer',
                fit:true,
                lines: true,
                rownumbers: true,
                striped: true,
                animate:true,
                singleSelect : true,
                showFooter: true,
                pagination: true,
                idField: 'custNo',
                queryParams: {
                    no: ''
                }
            " border="0">
            <thead data-options="frozen:true">
            <tr>
                <th data-options="field:'custNo'" width="15%">编码</th>
                <th data-options="field:'name'" width="15%">名称</th>
                <th data-options="field:'sex'" width="10%">性别</th>
                <th data-options="field:'birthday',formatter:dateFmt" width="10%">出生日期</th>
                <th data-options="field:'idType'" width="10%">证件类型</th>
                <th data-options="field:'idNo'" width="15%">证件号</th>
                <th data-options="field:'companyId'" width="15%">工作单位</th>
            </tr>
            </thead>
        </table>
        <table id="custSerPlanItem" title="" class="easyui-datagrid" style="display: none;"
               data-options="
                url: '${base}/dw_inter/query/custSerPItemList.do',
                title: '客户服务项目',
                iconCls: 'icon-log-viewer',
                fit:true,
                lines: true,
                rownumbers: true,
                striped: true,
                animate:true,
                singleSelect : true,
                showFooter: true,
                pagination: true,
                idField: 'custNo',
                queryParams: {
                    no: ''
                }
            " border="0">
            <thead data-options="frozen:true">
            <tr>
                <th data-options="field:'custNo'" width="30%">客户编码</th>
                <th data-options="field:'custSerPlanNo'" width="30%">服务计划编号</th>
                <th data-options="field:'custConState'" width="30%">保单状态</th>
            </tr>
            </thead>
        </table>
        <table id="servicePlan" title="" class="easyui-datagrid" style="display: none;"
               data-options="
                url: '${base}/dw_inter/query/servicePlanList.do',
                title: '服务计划信息',
                iconCls: 'icon-log-viewer',
                fit:true,
                lines: true,
                rownumbers: true,
                striped: true,
                animate:true,
                singleSelect : true,
                showFooter: true,
                pagination: true,
                idField: 'serPlanId',
                queryParams: {
                    no: ''
                }
            " border="0">
            <thead data-options="frozen:true">
            <tr>
                <th data-options="field:'serPlanId'" width="24%">计划编码</th>
                <th data-options="field:'serPlanName'" width="24%">计划名称</th>
                <th data-options="field:'effectiveDate',formatter:dateFmt" width="24%">生效日期</th>
                <th data-options="field:'endDate',formatter:dateFmt" width="24%">终止日期</th>
            </tr>
            </thead>
        </table>
        <table id="serPlanItem" title="" class="easyui-datagrid" style="display: none;"
               data-options="
                url: '${base}/dw_inter/query/serPlanItemList.do',
                title: '服务项目信息',
                iconCls: 'icon-log-viewer',
                fit:true,
                lines: true,
                rownumbers: true,
                striped: true,
                animate:true,
                singleSelect : true,
                showFooter: true,
                pagination: true,
                idField: 'serPlanId',
                queryParams: {
                    no: ''
                }
            " border="0">
            <thead data-options="frozen:true">
            <tr>
                <th data-options="field:'serPlanId'" width="24%">计划编码</th>
                <th data-options="field:'serItemNo'" width="24%">项目编码</th>
                <th data-options="field:'serItemName'" width="24%">项目名称</th>
                <th data-options="field:'prePersonTimes'" width="24%">项目每人次</th>
            </tr>
            </thead>
        </table>
    </div>
</div>

<div id="loadMask" class="loadMask">
    <img src="${base}/static/img/loading.gif" alt="加载中..."/>
</div>
<div id="userLoginWin" title="登录" style="padding:8px;z-index:1000" data-options="
                iconCls: 'icon-users',
                width: 460,
                buttons: [{
                    text:'确定',
                    iconCls:'icon-ok',
                    handler:function(){
                        var user=$('#userName').val();
                        var pswd=$('#userPswd').val();
                        if (user!='dwinter' && pswd!='dw170912') {
                            $.messager.show({
                                title:'登录失败',
                                msg:'用户或密码不对!',
                                timeout:5000,
                                showType:'slide'
                            });
                            return ;
                        }

                        $('#userLoginWin').dialog('close');
                        $('#loadMask').fadeOut();
                    }
                }]">
    <div class="easyui-panel" style="width:100%;padding:0px 10px;border:1px solid #f0ad4e">
        <div class="group-label">
            <p style="margin: 30px 2px;">
                <input id="userName" name="userName" class="easyui-textbox" data-options="label:'用户名：'" style="width:100%;" />
            </p>
            <p style="margin: 30px 2px;">
                <input type="password" id="userPswd" name="userPswd" class="easyui-textbox" data-options="label:'密码：'" style="width:100%;"/>
            </p>
        </div>
    </div>
</div>

<script type="text/javascript" src="${base}/static/js/jquery.min.js"></script>
<script type="text/javascript" src="${base}/static/vendor/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${base}/static/vendor/easyui/themes/insdep/jquery.insdep-extend.js"></script>
<script>

    $(function () {
        $('#userLoginWin').dialog({closable:false});

        $('#queryBtn').bind('click', function () {
            var no = $('#no').val();

            var val = $('#tableName').combobox('getValue');
            switch (val) {
               case 'DWCustomer':
                   reloadDG(no, 'customerInfo');
                   break;
               case 'DWCustomerSerItem':
                   reloadDG(no, 'custSerPlanItem');
                   break;
               case 'DWServicePlan':
                   reloadDG(no, 'servicePlan');
                   break;
               case 'DWSerPlanItem':
                   reloadDG(no, 'serPlanItem');
                   break;
            }
        });

    });

    function reloadDG(val, id) {
        var para = $('#'+id).datagrid('options').queryParams;
        para.no = val;
        $('#'+id).datagrid({'pageNumber': 1});
        $('#'+id).datagrid('reload');
    }

    function dateFmt(val,row) {
        return val.substring(0,10);
    }


    function onSelected(date) {
        $('#endDate').datebox('reset');
    }

    function dateFormatter(date) {
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        var d = date.getDate();
        return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
    }
</script>
</body>
</html>